package com.dragon.aipictures.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dragon.aipictures.domain.dto.request.space.SpaceAddRequest;
import com.dragon.aipictures.domain.dto.request.space.SpaceQueryRequest;
import com.dragon.aipictures.domain.entity.Space;
import com.dragon.aipictures.domain.entity.User;
import com.dragon.aipictures.domain.vo.space.SpaceVO;

import javax.servlet.http.HttpServletRequest;

/**
* @author 20390
* @description 针对表【space(空间)】的数据库操作Service
* @createDate 2025-01-21 10:08:38
*/
public interface spaceService extends IService<Space> {

    //校验前端传进来的空间参数
    void validSpace(Space space, boolean add);

    //根据前端传来的空间，自动填充一些数据，比如空间最大限额，最大图片数量，根据用户申请的空间等级，
    //自动为其填充数据
    void fillSpaceBySpaceLevel(Space space);

    long addSpace(SpaceAddRequest spaceAddRequest, User loginUser);


    QueryWrapper<Space> getQueryWrapper(SpaceQueryRequest spaceQueryRequest);

    void checkSpaceAuth(User loginUser, Space space);

    SpaceVO getSpaceVO(Space space, HttpServletRequest request);

    Page<SpaceVO> getSpaceVOPage(Page<Space> spacePage, HttpServletRequest request);
}
